package team.szm.scd.service.impl;

import lombok.SneakyThrows;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Service;
import team.szm.scd.database.entity.Topic;
import team.szm.scd.database.entity.TopicReply;
import team.szm.scd.utils.TimeUtils;

import java.time.LocalDateTime;
import java.time.LocalTime;

@Service
@Profile("test")
public class TestTopicServiceImpl extends AbstractTopicService {
    @SneakyThrows
    @Override
    public boolean createTopic(Topic topic, LocalDateTime now) {
        now = LocalDateTime.of(TimeUtils.testNowDate(), LocalTime.now());
        return super.createTopic(topic, now);
    }

    @SneakyThrows
    @Override
    public boolean replyTopic(TopicReply reply, LocalDateTime now) {
        now = LocalDateTime.of(TimeUtils.testNowDate(), LocalTime.now());
        return super.replyTopic(reply, now);
    }
}
